﻿using UnityEngine;

namespace Room
{
    class MonsterAIStateHold : MonsterAIStateBase
    {

        protected override void OnEnter()
        {
            OpenBattleScene();
            //controller.SwitchState(MonsterAIState.Dead);
            controller.owner.PlayAnim("standfight");
            var self = RoomManager.currentRoom.charactorManager.GetSelfCharactor();
            if(self!=null)
            {
                var ai = self.ai as RCAISelf;
                ai.StopAutoGo();
            }
        }

        private void OpenBattleScene()
        {
            StaticData.currFightTaskId = controller.taskId;
            //var copy = controller.owner.charactorManager.room as RoomCopy;

            ManagerController.Instance.CopyToBattle();
#if UNITY_EDITOR
            Debug.Log("[DEBUG] current fight task id:"+StaticData.currFightTaskId);
#endif
        }
    }
}

